﻿using System;
using System.Data;

namespace VitCode.Castle.Helper
{
    /// <summary>
    /// 输出参数,输入输出参数和返回值参数的特殊数值对象
    /// 用于在使用<see cref="SqlHelper"></see>的时候，参数的输入的时候使用
    /// </summary>
    public class NotInputParamterValue
    {
        private object m_Value;
        private ParameterDirection m_Direction = ParameterDirection.Output;
        private string m_Name;
        /// <summary>
        /// 
        /// </summary>
        public static NotInputParamterValue Instance
        {
            get { return new NotInputParamterValue(); }
        }

        /// <summary>
        /// 输出输入参数
        /// </summary>
        public virtual object Value
        {
            get { return m_Value; }
            set { m_Value = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        public virtual ParameterDirection Direction
        {
            get { return m_Direction; }
            set
            {
                if (value == ParameterDirection.Input)
                    throw new ArgumentException("不能设定为Input参数");
                m_Direction = value;
            }
        }

        /// <summary>
        /// 参数名称
        /// </summary>
        protected internal string Name
        {
            get { return m_Name; }
            set { m_Name = value; }
        }
    }
}
